Method and system for stylesheet execution interactive feedback

ABSTRACT

A method (and structure) for displaying mapping relationships defined by a plurality of instruction elements, each instruction element providing a relation between zero or more source elements and zero or more result elements, where each source element includes one of a plurality of source elements and each result element includes one of a plurality of result elements, including providing a user a representation including a portion of the mapping relationships and including one or more of the plurality of source elements, the plurality of instruction elements, and the plurality of result elements. The user is provided a method to select one of the elements in the representation. The selected element is highlighted in the representation and the highlighting can be propagated to any other elements related by the mapping that are displayed in the representation.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present Application is related to the following co-pendingapplications:

U.S. patent application Ser. No. 09/______, filed on ______, to Adler etal., entitled “METHOD AND SYSTEM FOR STYLESHEET-CENTRIC EDITING”, havingIBM Docket YOR920010685;

U.S. patent application Ser. No. 09/______, filed on ______, to Adler etal., entitled “METHOD AND SYSTEM FOR STYLESHEET RULE CREATION,COMBINATION, AND REMOVAL TECHNOLOGY”, having IBM Docket YOR920010609;and

U.S. patent application Ser. No. 09/______, filed on ______, to Adler etal., entitled “METHOD AND SYSTEM FOR COPY AND PASTE TECHNOLOGY FORSTYLESHEET EDITING”, having IBM Docket YOR920010631,

all assigned to the present assignee, and all incorporated herein byreference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to a method of displaying to auser the relationships between source, instruction, and result elementsof a mapped function by highlighting interrelated elements. In anexemplary embodiment, an XSLT (eXtensible Style LanguageTransformations) stylesheet editor incorporates this highlightingmethod, thereby allowing a user to better understand how the ruleswithin an XSLT stylesheet being edited will match input data and whatoutput data the rules will provide.

2. Description of the Related Art

An XSLT (eXtensible Style Language Transformations) stylesheet consistsof a set of rules that describes how to process elements found in aninput XML (eXtensible Markup Language) document into an XML outputdocument. Each rule matches one or more elements in the input documentand describes the actions to take and the output to produce when amatching element is found. The result of processing all of the elementsin the input document produces the output document.

Execution of an XSLT stylesheet is non-sequential. It is not like aprogram written in conventional programming languages such as C, C++,Java, Basic, FORTRAN, Cobol, etc. This non-sequential execution producesa barrier to IT professionals attempting to write and use it. It has avery different execution paradigm than those to which they areaccustomed. This means that tools for understanding execution of an XSLTstylesheet can be very different than similar tools for sequentialprogramming languages, such as “debuggers.”

Specific to the present invention, in development of a XSLT stylesheeteditor, one feature incorporated into the editor provides the means totrace and break execution of the stylesheet, analogous to that used in astandard debugger. The inventors realized that this method is notparticularly useful in the tree-structure environment of XSLT since itprovides a narrow window into the operation of the stylesheet.

SUMMARY OF THE INVENTION

In view of the foregoing problems, drawbacks, and disadvantages of theconventional systems, it is an object of the present invention toprovide a structure (and method) in which a non-recursive transformationprocess such as an XSLT stylesheet execution is presented using a methodof highlighting in a way that enhances the presentation of complexrelationships. An exemplary embodiment of the present invention is theincorporation into an editor for processing an XSL or XSLT stylesheet.

It is, therefore, an object of the present invention to teach astructure and method for an improved display to a user working with anyprocess in which a transformation mapping can be established betweeninput elements and output elements.

It is another object of the present invention to teach a method in whichmultiple input elements are related to multiple output elements by oneor more procedures.

It is another object of the present invention to teach a method in whichhighlighting can provide an indication of the relationship betweensource, result, and process elements.

It is another object of the present invention to teach a method in whichhighlighting can be propagated to show how an element selected by a useris related to a set of source, result, and process elements.

It is another object of the present invention to teach a method in whichat least two levels of highlighting provide an indication of primary andsecondary relationships.

It is another object of the present invention to teach this method asapplied to pipelined transformations.

It is another object of the present invention to teach this method in atree-structure environment in which highlighting takes on an explicitand implicit interpretation.

It is another object of the present invention to teach an exemplaryembodiment of this improved method of displaying in an XSLT stylesheeteditor.

In order to achieve the above goals and objectives, according to a firstaspect of the present invention, described herein is a method (and astructure and a signal-bearing medium) for displaying mappingrelationships defined by a plurality of instruction elements, eachinstruction element providing a relation between zero or more sourceelements and zero or more result elements, where each source element isone of a plurality of source elements and each result element is one ofa plurality of result elements, including providing a user arepresentation comprising a portion of the mapping relationships andincluding one or more of the plurality of source elements, the pluralityof instruction elements, and the plurality of result elements. The useris provided a method to select one of the elements in therepresentation. The selected element is highlighted in therepresentation and the highlighting can be propagated to any otherelements related by the mapping that are displayed in therepresentation.

This XSLT stylesheet editor, as developed by the assignee, uses thepresent invention to provide greater feedback to the user. The inventionpresents a view of the full scope of a stylesheet rule—all of thematched nodes, all of the result nodes, as well as the stylesheet rule.That is, given a selection by the user of any of these nodes, thisfeature highlights the rule, the matched node, and the result node(s).This technique improves the understanding of the stylesheet and itseffects during the editing process for the stylesheet. A fuller pictureis provided in tree-structure environments such as XML and, moregenerally, in any non-recursive transformation process.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other objects, aspects and advantages will be betterunderstood from the following detailed description of a preferredembodiment of the invention with reference to the drawings, in which:

FIG. 1 shows the concept of a transformation between source elements andresult elements by using process elements;

FIGS. 2 through 4 extend the concept of a process transformation to be amapping relationship, including cases in which a single processinstruction element is a basis for multiple mapping relationships;

FIGS. 5 and 6 provide a flowchart for an exemplary highlightingalgorithm that includes both primary and secondary highlighting;

FIGS. 7-9 demonstrate pipelining of process mapping;

FIG. 10 illustrates one example of a GUI representation of an XSLTeditor that exemplarily embodies the methods for highlighting of thepresent invention;

FIG. 11 illustrates an exemplary hardware/information handling system1100 for incorporating the present invention therein; and

FIG. 12 illustrates a signal bearing medium 1200 (e.g., storage medium)for storing steps of a program of a method according to the presentinvention.

DETAILED DESCRIPTION OF A PREFERRED EMBODIMENT OF THE INVENTION

Referring now to the drawings, and more particularly to FIG. 1, apreferred embodiment will now be described. FIG. 1 shows a process 10that reads an input set 111 of instruction elements and an input set 12of source elements to produce an output set 13 of result elements. Theprocess 10 produces “mapping relationships” of instruction elements,source elements, and result elements, as illustrated by FIG. 2. Themeaning of the mapping relationship is not relevant. It may be helpful,however, to consider, as a concrete example, that a mapping relationship20 between instruction, source, and result elements means that theinstruction element 21 “matched” the source element 22 and “produced”the result element 23.

The mapping relationships make no distinction concerning whether theelements of each set are structured in any way, as trees or lists, forexample, or even whether they come from the same source, such as a file.After execution of the process, the mapping, shown as a cloud 30 in FIG.3, will contain a large number of mapping relationships 31.

The method of the present invention comprises highlighting therelationships between source, instruction, and result elements. FIG. 4demonstrates the result of applying this method to the mappingrelationship found in FIG. 3. A user selects a result element 41 toinitiate the highlighting process. The process applies primaryhighlighting to element 41, and then propagates primary highlighting asfollows.

Result element 41 is traced back through its mapping relationship 42 tofind related elements 43 and 44. Primary highlighting is then applied toelements 43 and 44. However, process instruction element 43 is thenrecognized as actually corresponding to mapping relationships 45 and 47in addition to 42. Therefore, additional related elements 46, 48 and 49are recognized. Elements 41 and 44 are already highlighted. Secondaryhighlighting is applied to elements 46, 48, and 49 because ofassociation with process element 43, resulting in primary highlightingof elements 41, 43, and 44, and secondary highlighting of elements 46,48, and 49 in response to the user having selected generated resultelement 44.

This example demonstrates a selection as initiated with a resultelement. A user could have just as well selected source element 44 orinstruction element 43, in which case the highlighting process wouldcorrespondingly begin with the element selected.

FIGS. 5 and 6 contain flowcharts embodying an exemplary algorithm forachieving the primary and secondary highlighting described above, asfollows:

Selection of a result element primary highlights that element, and allelements that participate in a relationship mapping with that element.

Selection of a source or instruction element primary highlights thatelement.

Primary highlight of any element secondary highlights all elements thatparticipate in a relationship mapping with that element.

Secondary highlight of an instruction element secondary highlights allelements that participate in a mapping relationship with that element.

An element that is primary highlighted cannot be secondary highlighted.

The first step of FIG. 5 to clear all highlights is optional since itmay be desirable to allow highlights to accumulate.

Pipelining

The highlighting described herein is not limited to a single processmapping. Sometimes, the processes are pipelined, with the output of oneprocess forming the input for another, as exemplarily illustrated inFIG. 7 and FIG. 8.

In FIG. 7, the output of the first process 70 becomes input source forthe second process 71. In FIG. 8, the output from the first process 80becomes the input processing instructions for the second process 81.

In either case, the algorithm for highlighting does not change. The onlydifference is that the step of identifying mapping relationships willidentify relationships in more than one process mapping. For example, inFIG. 9, element 91 participates in mapping relationships 92, 93, whichrelate it to elements 94-97.

An Exemplary Embodiment: an XSLT Stylesheet

An XSLT stylesheet transforms source XML to result XML. The structureand content of the result are determined by the source as interpreted,sampled, or elaborated by the stylesheet:

-   -   Source-1+Stylesheet==>Result-1    -   Source-2+Stylesheet==>Result-2

An XML contains elements, attributes, and text. A stylesheet containsrules. Rules match elements, attributes, and/or text in the source. Whena rule matches, it executes in context of the matched source. Itproduces some result XML influenced by that context.

XML may be represented as a “tree” of “nodes”. Each node of the tree isan element or text. The node at the top of the tree is the “root”. Allof the nodes connected to the root are the “children” of the root, whichis their “parent”:

An XSLT stylesheet is itself written as XML. Each rule in the stylesheetis a node in a tree:

In an XSLT editor developed by the assignee of the present invention, amapping file is set up to record during execution of a stylesheet all ofthe matched source node, the stylesheet node of the rule that matched,and result nodes, providing a complete mapping of the relationships onthe stylesheet. This XSLT mapping is a straight forward implementationof the concepts demonstrated in FIGS. 1-4 and 7-9. This mapping permitsanswers to questions such as: which rule(s) was matched a given sourcenode?; and, which result nodes were output from that match?

FIG. 10 shows a sample GUI representation 100 of the XSLT editor showinga stylized presentation 101 of the rules of the stylesheet being editedby the user, a stylized presentation 102 of the XML input source, and astylized presentation 103 of the XML output that results from theprocessing of the input source elements by the rules of the stylesheet.

In this embodiment there are two types of selection, “explicit” and“implied”, which have a different appearance in the tree views of theeditor GUI representation. In the environment of the present invention,the terms “explicit” and “implied” are similar to “primary” and“secondary”, respectively, and should be considered equivalent forpurpose of this disclosure. The intended distinction is subtle. Thefirst two terms refer to the semantic domain, and the second two termsrefer to the visual domain.

A method for selecting a node of any of the trees is provided, forexample, by a mouse click. The selected node is highlighted with anexplicit selection. The explicit selection clears all previousselections (explicit or implicit), although this step is optional sinceit might be desirable to allow highlights to accumulate.

The selection is then propagated, as follows:

Selection in the Result:

Explicit selection of a result node creates an implied selection of therule node in the stylesheet tree that produced the selected result node.

Implied selection of a result node does not propagate.

Selection in the Stylesheet:

Explicit selection of a stylesheet node creates:

-   -   an implied selection of all result nodes generated by the        selected rule, and    -   an implied selection of all source nodes matched by the selected        rule.

Implied selection of a stylesheet node creates:

-   -   an implied selection of all result nodes generated by the        selected rule, and    -   an implied selection of all source nodes matched by the selected        rule.        Selection in the Source:

Explicit selection of a source node creates an implied selection of allrules that matched the selected node.

Implied selection of a source node does not propagate.

In all cases, propagation of implicit selection does not alter theexplicit selection, or, stated differently, a node that is bothexplicitly and implicitly selected appears explicitly selected.Selection highlights the relationships of source, stylesheet, and resultXML generated by the transformation of the source by the stylesheet.

Propagation Through Pipelines of Stylesheets

It is more and more common that XSL Transforms may be pipelined suchthat the output of one transform is the input to another.

The present invention propagates selections along the chain by treatinga selection in Intermediate as a selection of the result of Transform-1and of the source of Transform-2.

Propagation Through Stylesheets that Produce Stylesheets

It is less common, but sometimes arranged that the result of a transformmay itself be a stylesheet which is in turn applied to a differentsource.

The present invention propagates selections by treating a selection inIntermediate as a selection of the result of Transform-1 and of thestylesheet of Transform-2.

The method of the present invention can apply not only to XSLTexecution, but to any non-recursive transformation process. Neither mustit necessarily be limited to tree transformations. The input and outputmay have any structure. The method may apply, for example, to theexecution of awk scripts in which a record-oriented input is matched toproduce text output.

FIG. 11 illustrates a typical hardware configuration of an informationhandling/computer system which can be used with the invention and whichpreferably has at least one processor or central processing unit (CPU)1111.

The CPUs 1111 are interconnected via a system bus 1112 to a randomaccess memory (RAM) 1114, read-only memory (ROM) 1116, input/output(I/O) adapter 1118 (for connecting peripheral devices such as disk units1121 and tape drives 1140 to the bus 1112), user interface adapter 1122(for connecting a keyboard 1124, mouse 1126, speaker 1128, microphone1132, and/or other user interface device to the bus 1112), acommunication adapter 1134 for connecting an information handling systemto a data processing network, the Internet, an Intranet, a personal areanetwork (PAN), etc., and a display adapter 1136 for connecting the bus1112 to a display device 1138 and/or printer 1139 (e.g., a digitalprinter or the like).

In addition to the hardware/software environment described above, adifferent aspect of the invention includes a computer-implemented methodfor performing the above method. As an example, this method may beimplemented in the particular environment discussed above.

Such a method may be implemented, for example, by operating a computer,as embodied by a digital data processing apparatus, to execute asequence of machine-readable instructions. These instructions may residein various types of signal-bearing media.

Thus, this aspect of the present invention is directed to a programmedproduct, comprising signal-bearing media tangibly embodying a program ofmachine-readable instructions executable by a digital data processorincorporating the CPU 1111 and hardware above, to perform the method ofthe invention.

This signal-bearing media may include, for example, a RAM containedwithin the CPU 1111, as represented by the fast-access storage forexample. Alternatively, the instructions may be contained in anothersignal-bearing media, such as a magnetic data storage diskette 1200(FIG. 12), directly or indirectly accessible by the CPU 1111.

Whether contained in the diskette 1200, the computer/CPU 1111, orelsewhere, the instructions may be stored on a variety ofmachine-readable data storage media, such as DASD storage (e.g., aconventional “hard drive” or a RAID array), magnetic tape, electronicread-only memory (e.g., ROM, EPROM, or EEPROM), an optical storagedevice (e.g. CD-ROM, WORM, DVD, digital optical tape, etc.), paper“punch” cards, or other suitable signal-bearing media includingtransmission media such as digital and analog and communication linksand wireless. In an illustrative embodiment of the invention, themachine-readable instructions may comprise software object code.

While the invention has been described in terms of a single preferredembodiment, those skilled in the art will recognize that the inventioncan be practiced with modification within the spirit and scope of theappended claims.

1.-7. (canceled)
 8. A data processing system for displaying mappingrelationships wherein each said mapping relationship maps a resultelement a source element and an instruction element that are related toeach other and a display of said mapping relationship comprising aplurality of source elements and a plurality of instruction elementssaid mapping relationships defined by a plurality of instructionelement, the data processing system comprising: a bus, a display deviceconnected to the bus; a communications unit connected to the bus; astorage device connected to the bus wherein the storage device includescomputer usable program code; and a processor unit connected to the bus,wherein the processor unit executes the computer usable program code toprovide a representation comprising a portion of said mappingrelationships and including at least one of said plurality of sourceelements, said plurality of instruction elements, and said plurality ofresult elements; responsive to selecting one of said result elements insaid representation, form a selected result element, primaryhighlighting said selected result element in said representation,wherein the primary highlighting indicates elements that are directlyrelated to said selected result element; responsive to said selectedresult element being primary highlighted, automatically highlight otherelements related by one of said mapping relationships that are displayedin said representation, wherein automatically highlighting furthercomprises: the processor unit executing the computer usable program codeto primary highlight a source element and an instruction element thatare directly related to said selected result element by the one of saidmapping relationships as defined in the mapping relationshipcorresponding to said selected result element, forming a directlyrelated source element and a directly related instruction element;responsive to primary highlighting the directly related instructionelement, secondary highlight other source elements and result elementsthat are related to the directly related instruction element as definedin other said mapping relationships associated with the directly relatedinstruction element, wherein the secondary highlighting indicateselements that are related to the source elements and the instructionelements that are directly related to said selected result element bythe other said mapping relationships; and wherein said plurality ofinstruction elements comprises an XSLT (eXtensible Style LanguageTransformations) stylesheet said plurality of source elements comprisesXML (eXtensible Markup Language) source elements and said plurality ofresults elements comprises XML result elements.
 9. The data processingsystem of claim 8, further comprising: the processor unit executing thecomputer usable program code to provide an input to cause an executionof a transformation process that defines said mapping relationships,said input causing said source elements to become an input into at leastone of said instruction elements to produce at least one of said resultelements.
 10. The data processing system of claim 9, further comprising:the processor unit executing the computer usable program code toestablish a mapping file providing a correspondence between saidplurality of source elements, said plurality of instruction elements,and said plurality of result elements, based upon said source elementshaving been processed by said plurality of instruction elements in saidtransformation process.
 11. The data processing system of claim 10,wherein the processor executing the computer usable program code toautomatically highlight comprises: the processor unit executing thecomputer usable program code to determine from said mapping file whichof said source elements, said instruction elements match the at leastone of said source elements, and which of said result elements areoutputs of the matching correspond to said selected element; andsecondary highlight the at least one of said source elements and any ofsaid corresponding instruction elements that match the at least one ofsaid source elements currently visible on said representation saidrepresentation being user-controlled.
 12. The data processing system ofclaim 11, further comprising: an input device for providing a user aninput command to request said propagation determination to occur. 13.(canceled)
 14. (canceled)
 15. A computer program product comprising: acomputer recordable medium having computer usable program code fordisplaying mapping relationships, wherein each said mapping relationshipmaps a result element, a source element, and an instruction element thatare related to each other and a display of said mapping relationshipcomprising a plurality of source elements and a plurality of instructionelements, said mapping relationships defined by a plurality ofinstruction elements the computer program product comprising: computerusable program code for providing a representation comprising a portionof said mapping relationships and including at least one of saidplurality of source elements, said plurality of instruction elements,and said plurality of result elements; computer usable program coderesponsive to selecting one of said result elements in saidrepresentation forming a selected result element for primaryhighlighting said selected result element in said representation whereinthe primary highlighting indicates elements that are directly related tosaid selected result element; and computer usable program code,responsive to said selected result element being primary highlighted,for automatically highlighting other elements related by one of saidmapping relationships that are displayed in said representation, whereinthe automatically highlighting step comprises: computer usable programcode for primary highlighting a source element and an instructionelement that are directly related to said selected result element by theone of said mapping relationships as defined in the mapping relationshipcorresponding to said selected result element, forming a directlyrelated source element and a directly related instruction element;computer usable program code, responsive to primary highlighting thedirectly related instruction element, for secondary highlighting othersource elements and result elements that are related to the directlyrelated instruction element, as defined in other said mappingrelationships associated with the directly related instruction element,wherein the secondary highlighting indicates elements that are relatedto the source elements and the instruction elements that are directlyrelated to said selected result element by the other said mappingrelationships; and wherein said plurality of instruction elementscomprises an XSLT (eXtensible Style Language Transformations) stylesheetsaid plurality of source elements comprises XML (eXtensible MarkupLanguage) source elements and said plurality of results elementscomprises XML result elements.
 16. The computer program product of claim15, further comprising: computer usable program code for providing aninput to cause an execution of a transformation process that definessaid mapping relationships, said input causing said source elements tobecome an input into at least one of said instruction elements toproduce at least one of said result elements.
 17. The computer programproduct of claim 16, further comprising: computer useable program codefor establishing a mapping file providing a correspondence between saidplurality of source elements, said plurality of instruction elements,and said plurality of result elements, based upon said source elementshaving been processed by said plurality of instruction elements in saidtransformation process.
 18. The computer program product of claim 17,wherein the computer useable program code for automatically highlightingcomprises: computer useable program code for determining from saidmapping file which of said source elements, said instruction elementsmatch the at least one of said source elements, and which of said resultelements are outputs of the matching correspond to said selectedelement; and computer useable program code for secondary highlightingthe at least one of said source elements and any of said correspondinginstruction elements that match the at least one of said source elementscurrently visible on said representation said representation beinguser-controlled.
 19. The computer program product of claim 18, furthercomprising: computer useable program code for providing a user an inputas a command to request said determination to occur.
 20. (canceled)